<template>
  <div>
    <div class="header_box">
      <van-nav-bar title="申请结果" left-arrow @click-left="back"></van-nav-bar>
    </div>
    <!--    内容部分-->
    <div class="pre-screening-results">
      <div class="resultsStatus">
        <template v-if="type == '' || type == undefined">
          <van-icon name="checked"/>
          <p class="success-title">{{ this.lcType == 'xdlc' ? '续贷成功' : '已申请额度' }}</p>
          <p class="money-value" v-if="this.lcType!='xdlc'">{{ abTools.comdify(Number(applyamt).toFixed(2)) }}元</p>
          <!-- <p class="title">通过</p> -->
          <!-- <p class="refuseTip" style="text-align: center">您已通过线上预筛选，客户经理将尽快与您联系！</p> -->
        </template>
        <template v-if="type == 'refuse'">
          <van-icon name="clear"/>
          <p class="title">{{ this.lcType == 'xdlc' ? '拒绝' : '未通过' }}</p>
          <p class="refuseTip" style="text-align: center">
            {{ this.lcType == 'xdlc' ? '非常抱歉，您暂不满足续贷，感谢您的支持！' : '非常抱歉，您暂不满足我行授信要求，感谢您的支持！' }}
          </p>
        </template>
        <template v-if="type == 'await'">
          <van-icon name="clock"/>
          <p class="title">{{ this.lcType == 'xdlc' ? '受理中' : '审核中' }}</p>
          <p class="refuseTip" style="text-align: center">
            {{ this.lcType == 'xdlc' ? '请稍后，续贷申请受理中！' : '系统处理中，预筛选通过后，客户经理将尽快与您联系！' }}
          </p>
        </template>
      </div>
      <div class="btn-group">
        <div class="btn">
          <router-link :to="{ path:'/loanPage/newHome' }">返回首页</router-link>
        </div>
        <!--        <div class="btn btn-primary" v-if="type == '' || type == undefined">-->
        <!--          <router-link :to="{ path:'/loanPage/newHome' }">立即用款</router-link>-->
        <!--        </div>-->
      </div>
      <div v-if="this.lcType!='xdlc'">
        <div class="amttip" v-if="type == '' || type == undefined">温馨提示：最终额度以实际审批结果为准。</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "gzAdopt",
  data() {
    return {
      instId: this.$route.query.instId,
      lcType: this.$route.query.lcType,//当前是什么流程
      type: '',
      applyamt: '',
    }
  },
  mounted() {
    if (this.instId) {
      // this.getResult(this.instId)
    }
    this.applyamt = this.$route.query.applyamt;
  },
  methods: {
    back() {
      this.$router.replace({path: '/loanPage/newHome'})
      // this.$router.back()
    },
    getResult(instId) {
      let params = {
        instId: instId
      }
      this.baseService
        .getParams(this.__ctx + "/bpm/ret_suggResult", params)
        .then((data) => {
          if (data.isOk) {
            this.result = data.data.SUGG_RESULT
          }
        }).catch(err => {
        console.log(err)
      });
    }
  }
}
</script>

<style scoped lang="less">
/deep/ .van-nav-bar {
  .van-nav-bar__content {
    height: 4.4rem;
    line-height: 2rem;

    .van-icon {
      color: rgb(50, 50, 51);
      font-size: 2rem;
    }

    .van-nav-bar__title {
      font-size: 1.8rem;
    }
  }
}

.content_box {
  margin: 5.8rem 0rem 0rem 0rem;
}

.pre-screening-results {
  font-size: 1.3rem;
  line-height: 2rem;
  font-family: PingFang SC-Regular, PingFang SC;
  font-weight: 400;
  color: rgb(134, 144, 156);
  background-color: #FFFFFF;
  height: calc(~'100vh - 4.4rem');
  position: relative;
}

.pre-screening-results .resultsStatus {
  padding: 4rem;
  text-align: center;
}

.pre-screening-results .refuseTip {
  text-align: left;
}

.pre-screening-results .van-icon-clear {
  color: rgb(254, 93, 61) !important;
  font-size: 6rem;
}

.pre-screening-results .van-icon-checked {
  color: rgb(97, 210, 67) !important;
  font-size: 6rem;
}

.pre-screening-results .van-icon-clock {
  color: #FFA500 !important;
  font-size: 6rem;
}

.pre-screening-results .title {
  font-size: 2rem;
  color: rgb(78, 89, 105);
  margin: 1.6rem;
}

.pre-screening-results .btn-group {
  display: flex;
  justify-content: center;
}

.pre-screening-results .btn {
  width: 30%;
  padding: 6px 0;
  font-size: 1.4rem;
  font-weight: 400;
  text-align: center;
  border-radius: 4.4rem;
  margin: 0 0.8rem;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.pre-screening-results .btn a {
  color: var(--primary-color);
}

.pre-screening-results .btn-primary {
  color: #ffffff;
  border: 1px solid var(--primary-color);
  background: var(--primary-color);
}

.pre-screening-results .btn-primary a {
  color: #ffffff;
}

.footer {
  /*width: calc(100% - 4.8rem);*/
  padding: 0 2.4rem;
  /*position: fixed;*/
  position: absolute;
  bottom: 2.4rem;
  left: 0;
  font-size: 1.2rem;
  color: rgb(134, 144, 156);
}

.footer div {
  color: rgb(78, 89, 105);
  font-size: 1.2rem;
  line-height: 2rem;
}

.footer .refuseTip {
  text-align: center;
}

.footer .red {
  color: rgb(255, 74, 50);
  margin-top: 0.5rem;
  text-align: center;
}

.success-title {
  font-size: 1.5rem;
  font-weight: 400;
  color: #4e5969;
  text-align: center;
  margin-top: 1.6rem;
}

.money-value {
  font-size: 2rem;
  font-weight: 700;
  color: rgb(29, 33, 41);
  text-align: center;
  margin-top: 1.6rem;
}

.amttip {
  color: rgba(29, 33, 41, 0.54);
  text-align: center;
  margin: 2.6rem 1.6rem 0;
  font-size: 1.3rem;
}
</style>
